<?php
	$v_user_name = (isset($_REQUEST["txt_user_name"])) ? $_REQUEST["txt_user_name"] : "";
	$v_password = (isset($_REQUEST["txt_user_password"])) ? $_REQUEST["txt_user_password"] : "";
	
	if ($v_user_name == "" || $v_password == "")
		redir( URL . "dang-nhap" );
	$v_user_name = trim($v_user_name);
	$v_password = trim($v_password);
    
	if ( check_admin($v_user_name,$v_password) )
	{
		$v_sval = true;
		if ( isset($_SESSION['user_type']) &&  $_SESSION['user_type'] == ADMIN_ACCOUNT ){
			redir( URL . "?a=ACC" );
		}
		elseif ( isset($_SESSION['user_type']) && $_SESSION['user_type'] == USER_ACCOUNT ){
			redir( URL . "?a=ACC&acc=USER&user=HOME");
		}
	}
	else
	{
		redir( URL . "dang-nhap" );
	}
		
?>
